package com.mai4j.maiadmin.misc;

import org.apache.commons.codec.digest.DigestUtils;
import org.jooq.Select;

/**
 * 微信公众号请关注: 开源螺丝钉
 * <br>
 * 码云请关注: <a href="https://gitee.com/xiyoufang">https://gitee.com/xiyoufang</a>
 * <br>
 * 哔哩哔哩请关注: <a href="https://space.bilibili.com/438927834">https://space.bilibili.com/438927834</a>
 *
 * @author xiyoufang
 */
public class CacheUtils {
    /**
     * 生成缓存的KEY
     *
     * @param query query
     * @return key
     */
    public static String genKey(Select<?> query) {
        return DigestUtils.sha256Hex(query.toString());
    }
}
